<%@page import="java.util.List,com.crm.beans.SupplyParts,java.sql.Date" %>
<%
	String date=request.getAttribute("Date").toString();
	String invoiceNo=request.getAttribute("invoiceNo").toString();
	String soNo=request.getAttribute("soNo").toString();
	String terms=request.getAttribute("terms").toString();

%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
          <tr>
            <td width="28" height="30" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"  style="background-repeat:repeat-x">S.No</td>
            <td width="122" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF"> Part Number </td>
            <td width="135" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Description</td>
             <td width="135" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Make</td>
            <td width="99" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Qty</td>
            <td width="117" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Unit Price </td>
            <td width="152" align="left" valign="middle" background="<%=application.getContextPath() %>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Sub Total </td>
          </tr>
          
          <%
          if(request.getAttribute("soParts")!=null){
        	  List<SupplyParts> lso=(List<SupplyParts>)request.getAttribute("soParts");
        	  for(int i=0;i<lso.size();i++){
          %>
          <tr>
            <td bgcolor="#FFFFFF"><label>
            <input name="sno<%=i+1 %>" type="text"value="<%=i+1 %>" size="5" />
            </label></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="partNumber<%=i+1 %>" type="text"value="<%=lso.get(i).getPartNo() %>" size="5"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="description<%=i+1 %>" type="text"value="<%=lso.get(i).getDesc() %>" size="5"/></td>
             <td align="left" valign="top" bgcolor="#FFFFFF"><input name="make<%=i+1 %>" type="text"value="<%=lso.get(i).getMake() %>" size="5"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="qty<%=i+1 %>" type="text" value="<%=lso.get(i).getQty() %>" size="5"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="unitPrice<%=i+1 %>" type="text" value="<%=lso.get(i).getUnitPrice() %>" size="5"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="subTot<%=i+1 %>" type="text" value="<%=lso.get(i).getTotalcost() %>" size="5"/></td>
          </tr>
          <%  }%>
        	<input type="hidden" name="rowCount" value="<%=lso.size()%>"/>  
        	<%
          } %>
          
        </table>
	<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="width: 400px; height: 353px"><table>
	<tr> <td align="center" valign="top">Supply Order No: </td>
                <td align="left" valign="top" ><input name="soNo" type="text" class="form" value="<%=soNo %>" /></td>
                           
        </tr>
        <tr><td>&nbsp;</td></tr>
        <tr>
                <td align="center" valign="top">Supply Order Date :</td>
                <td align="left" valign="top"><input name="soDate" type="text" class="form" value="<%=date %>" /></td>
                           
        
              </tr>
               <tr><td>&nbsp;</td></tr>
               <tr>
                <td align="center" valign="middle">SupplyOrder DueDate :</td>
                <td align="left" valign="top"><input name="sodueDate" id="sodueDate" type="text" class="form"  /></td>
                           
        
              </tr>
               <tr><td>&nbsp;</td></tr>
              <tr>
                <td align="center" valign="top">Invoice No </td>
                <td align="left" valign="top"  ><input name="invoiceNo" type="text" class="form" value="<%=invoiceNo %>" /></td>
              </tr>
              <tr><td>&nbsp;</td></tr>
             </table>
             </td>
             <td align="right"><table> 
<tr><td valign="top" align="center" style="height: 20px; ">Terms And Conditions</td></tr>
      <tr><td valign="middle" align="right">
       <textarea rows="12" cols="50" name="terms"><%=terms %></textarea>
       </td></tr>
       <tr><td align="right" style="height: 60px; "><input type="submit" class="button" value="Generate Invoice"/></td></tr></table> </td></tr></table>
       <script type="text/javascript">
       $(function(){
			 var client="<%=request.getAttribute("clientdet")%>";
			 var cldiv="<%=request.getAttribute("division")%>";
			 var cluser="<%=request.getAttribute("user")%>";
			 $("#enqclient").html("Client Name Is:<span class='cliendet'>"+client +
			"</span>   &nbsp;&nbsp;&nbsp;&nbsp;  Client Division Is:<span class='cliendet'>"+cldiv+
			 "</span>    &nbsp;&nbsp;&nbsp;&nbsp;    Client User Is:<span class='cliendet'>"+cluser+"</span>");
			 $("#enqclient").show();
		});  
       $(function() {
   		$( "#sodueDate" ).datepicker({minDate:0, dateFormat: "dd-mm-yy" },"option", "autoSize", true);
   	});
       </script>